package cn.java75.sp;

import cn.java75.sp.entity.Admin;
import cn.java75.sp.filter.TimeFilter;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.AutoConfigurationImportSelector;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ImportResource;
import org.springframework.core.io.support.SpringFactoriesLoader;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;

import javax.annotation.Resource;

//@EnableCaching
@SpringBootApplication
@ServletComponentScan
@MapperScan(basePackages = "cn.java75.sp.dao")
//@ImportResource("classpath:xx.xml")
public class SpringbootApplication {


    public static void main(String[] args) {
        //AutoConfigurationImportSelector f=null;
        //SpringFactoriesLoader fff=
        //ConfigurableApplicationContext f=null;
        SpringApplication.run(SpringbootApplication.class, args);
    }

//    @Bean
//    public FilterRegistrationBean getTimeFilter(TimeFilter f2){
//        FilterRegistrationBean f=new FilterRegistrationBean();
//        f.setFilter(f2);
//        f.setName("timeFilter");
//        f.addUrlPatterns("/student/*","/login","/login*","/login/*","/admin/*","*.html");
//        f.setOrder(-1);//@Order
//        return f;
//    }
//    @Bean
//    public TimeFilter get(){
//        return new TimeFilter();
//    }
}
